package com.yantong.mapper;

import com.yantong.pojo.Brokerage;
import com.yantong.pojo.TBusinessCard;
import com.yantong.pojo.vo.BrokerageVo;
import com.yantong.pojo.CommissionLog;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 电子名片信息Mapper接口
 *
 * @author pwang
 * @date 2020-11-03
 */
public interface TBusinessCardMapper {

    /**
     * 搜索
     * @param tCardId
     * @param wxCodeOrPhone
     * @return
     */
    public List<TBusinessCard>  searchMyFriends(@Param("tCardId") Long tCardId, @Param("wxCodeOrPhone") String wxCodeOrPhone);

    /**
     * 我的好友
     * @param tCardId
     * @return
     */
    public List<TBusinessCard>  myFriends(@Param("tCardId") Long tCardId, @Param("industryId") String industryId);

    public TBusinessCard selectCardByPhone(@Param("phone") String phone);

    /**
     * 查询电子名片信息
     * @param tCardId
     * @param phone
     * @return
     */
    public TBusinessCard selectTBusinessCardByPhone(@Param("tCardId") Long tCardId, @Param("phone") String phone);

    /**
     * 查询电子名片信息
     *
     * @param id 电子名片信息ID
     * @return 电子名片信息
     */
    public TBusinessCard selectTBusinessCardById(Long id);

    /**
     * 查询电子名片信息列表
     *
     * @param tBusinessCard 电子名片信息
     * @return 电子名片信息集合
     */
    public List<TBusinessCard> selectTBusinessCardList(TBusinessCard tBusinessCard);

    /**
     * 新增电子名片信息
     *
     * @param tBusinessCard 电子名片信息
     * @return 结果
     */
    public int insertTBusinessCard(TBusinessCard tBusinessCard);

    /**
     * 修改电子名片信息
     *
     * @param tBusinessCard 电子名片信息
     * @return 结果
     */
    public int updateTBusinessCard(TBusinessCard tBusinessCard);

    /**
     * 删除电子名片信息
     *
     * @param id 电子名片信息ID
     * @return 结果
     */
    public int deleteTBusinessCardById(Long id);

    /**
     * 批量删除电子名片信息
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTBusinessCardByIds(String[] ids);


    int countBybrokerageListt(Map<String, Object> params);
    List<BrokerageVo> brokerageList(Map<String, Object> params, RowBounds rowBounds);
    BrokerageVo getBrokerageById(Long id);

    int insertCommission(CommissionLog commissionLog);

    int countByCommissionLogList(Map<String, Object> params);
    List<CommissionLog> commissionLogList(Map<String, Object> params, RowBounds rowBounds);
    TBusinessCard selectTBusinessCardByMemberId(Long mid);
    BigDecimal getCommissionAmountByMid(Map<String, Object> params);
    public void editBrokerage(Brokerage brokerage);

    List<TBusinessCard> selectByAll();
}
